package com.gyul.findmystock;

import android.app.Application;

import com.gyul.findmystock.util.Configs;
import com.gyul.findmystock.util.Constants;
import com.gyul.findmystock.util.PreferencesUtils;

public class FindMyStockApplication extends Application {
	@Override
	public void onCreate() {
		super.onCreate();
		Configs.context = this.getApplicationContext();
		PreferencesUtils.initialize();
		
		int analysisInterval = PreferencesUtils.getInt(Constants.ANALYSIS_INTERVAL);
		int analysisLevel = PreferencesUtils.getInt(Constants.ANALYSIS_LEVEL);
				
		if (analysisInterval == -1 ) {
    		PreferencesUtils.setInt(Constants.ANALYSIS_INTERVAL, Constants.THIRTY_MINUTE_INTERVAL);
    	} 
    	
    	if (analysisLevel == -1 ) {
    		PreferencesUtils.setInt(Constants.ANALYSIS_LEVEL, Constants.INIT_ANALYSIS_LEVEL);
    	} 
		
	}
}
